#!/bin/bash

rm -rf  /home/mysql/backup/$(date +%Y_%m_%d --date='1 days ago')*.sql.gz

cd /home/mysql/backup/
/usr/local/mysql/bin/mysqldump -u root -Q -R --port=3306 --socket=/data/commentdb_3306/mysql.sock  comment3306 > /home/mysql/backup/`date +'%Y_%m_%d'`comment3306.sql
gzip `date +'%Y_%m_%d'`comment3306.sql;
